public class DataSourceSingleton4 {
        //1.私有的构造方法
        private DataSourceSingleton4(){};
        //2.私有属性
        private static volatile DataSourceSingleton4 dataSource=null;
        //3.提供公共的方法，得到单例对象
        public static DataSourceSingleton4 getInstance(){
            if(dataSource==null){//大致分流
                synchronized (DataSourceSingleton4.class){
                    if(dataSource==null) {//精细化的判断
                        dataSource = new DataSourceSingleton4();
                    }
                }
            }
            return dataSource;
        }
    }
